<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  
  <script>

    var currentIndex = 5
    // 自己自增或者自减是没有区别
    // ++currentIndex
    // console.log(currentIndex)
    // --currentIndex
    // console.log(currentIndex)

    // 自增和自减表达式本身又在其他的表达式中, 那就有区别
    // var result1 = 100 + currentIndex++
    // console.log(currentIndex) // => 6
    // console.log("result1:" + result1) // => result2:105
    
    var result2 = 100 + ++currentIndex
    console.log(currentIndex) // => 6
    console.log("result2:" + result2) // => result2:106

  </script>

</body>
</html>